package com.gis.postgis.jts.bean;


import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.gis.postgis.geojson.GeoJsonObject;
import com.gis.postgis.geojson.annotation.GeoJsonGeometry;
import com.gis.postgis.geojson.annotation.GeoJsonId;
import com.gis.postgis.geojson.annotation.GeoJsonProperty;
import com.gis.postgis.geojson.annotation.GeoJsonType;
import com.gis.postgis.geojson.crs.Crs;
import com.gis.postgis.geojson.deserializer.GeoJsonDeserializer;
import com.gis.postgis.geojson.serializer.FeatureType;
import com.gis.postgis.geojson.serializer.GeoJsonSerializer;
import org.locationtech.jts.geom.Geometry;

/**
 * 〈功能简述〉<br>
 * 〈〉
 *
 * @author Mr.QL
 * @ClassName Feature
 * @Date 2022-03-05 13:34
 * @Version 1.0
 */
@GeoJsonType(type = FeatureType.FEATURE)
@JsonSerialize(using = GeoJsonSerializer.class)
@JsonDeserialize(using = GeoJsonDeserializer.class)
public class Feature extends GeoJsonObject {

    private Long id;

    private String name;

    private String description;

    private Geometry location;


    public Feature() {
    }

    public Feature(Long id, String name, String description, Geometry location) {
        this.id = id;
        this.name = name;
        this.description = description;
        this.location = location;
    }


    @GeoJsonId
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
    @GeoJsonProperty
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    @GeoJsonProperty
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
    @GeoJsonGeometry
    public Geometry getLocation() {
        return location;
    }

    public void setLocation(Geometry location) {
        this.location = location;
    }

    @Override
    public String toString() {

        return "Feature{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", description='" + description + '\'' +
                ", location=" + location +
                '}'+super.toString();
    }
}
